package com.health.home.service.lmpl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.health.common.core.po.DepartmentPo;
import com.health.home.domain.Department;
import com.health.home.mapper.DepartmentMapper;
import com.health.home.service.DepartmentService;
import io.micrometer.common.util.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xpz
 * @date 2024/12/11 16:27
 */
@Service
public class DepartmentServicelmpl extends ServiceImpl<DepartmentMapper, DepartmentPo> implements DepartmentService {
    @Override
    public List<DepartmentPo> lists(Department department) {
        LambdaQueryWrapper<DepartmentPo> wrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotBlank(department.getDepartmentName())){
            wrapper.eq(DepartmentPo::getDepartmentName,department.getDepartmentName());
        }
        List<DepartmentPo> list = list(wrapper);
        return list;
    }
}
